/*
 * @Author: Clark
 * @Email: haixuanwoTxh@gmail.com
 * @Date: 2022-10-13 16:13:21
 * @LastEditors: Clark
 * @LastEditTime: 2022-10-15 11:19:28
 * @Description: file content
 */

#ifndef PROTOCOL_H
#define PROTOCOL_H

#include "../common/common.h"

class Protocol
{
private:
    /* data */
public:
    Protocol();
    ~Protocol();

    bool build_packet();
    bool parse_packet();

private:
    /**
     * @brief 获取parity校验码，数据的字节异或
     * @param data 		数据
     * @param dataLen	数据长度
     * @param checksum	校验码结果
     * @return true		成功
     * @return false	失败
     */
    bool get_xor_checksum(uint8_t *data, int dataLen, uint8_t *checksum);
};

#endif
